package com.feeling.oafeeling.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.feeling.oafeeling.pojo.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    SysUser findByCondition(SysUser user);

    SysUser findUserAndRoleById(Long userId);

    List<SysUser> findByPage(int currentPage, int pageSize, SysUser user);

    SysUser findFromId(Long id);

//    List<SysUser> findOne(@Param("userId") Long userId,
//                    @Param("nickName") String nickName,
//                    @Param("deptName") String deptName,
//                    @Param("status") Integer status);
    List<SysUser> findOne(SysUser user);

    Boolean updateInstitutionForUser(Long userId, String institutionName);
    Boolean updatePasswordForUser(SysUser user);

    Boolean defaultUserNameSet(Long userId, String nickName);

    Boolean updateUser(SysUser user);

    Boolean updateFromId(SysUser user);

    String selectDeptNameById(Long deptId);

    Integer getUserSize();
}
